<!--
/*
*All rights reserved: Json.
*Links:http://www.liyaoquan.cn.
*Links:http://imarkchina.cn.
*Links:http://www.imarkchina.cn.
*/
-->
<link rel="stylesheet" type="text/css" media="all" href="{$__TPL__}Public/Css/pinglun.css"/>
<script type="text/javascript" src="{$__TPL__}Public/Js/jquery.min.js"></script>
<script type="text/javascript" src="{$__TPL__}Public/Js/jquery.Msg.js"></script>
<script type="text/javascript">
	var fix = "{$fix}";
	function verifyChek(){
		var verifyUrl="{U('pinglun/verify' , 'pverify', true)}" + fix;
		var verify=document.getElementById('verify');
		verify.setAttribute('src',verifyUrl + Math.random());
	}

	function verifyregChek(){
		var verifyUrl="{U('user/users/regverify' , 'rverify', true)}" + fix;
		var verify=document.getElementById('regverify');
		verify.setAttribute('src',verifyUrl + Math.random());
	}

	function verifyloginChek(){
		var verifyUrl="{U('user/users/loginverify' , 'lverify', true)}" + fix;
		var verify=document.getElementById('loginverify');
		verify.setAttribute('src',verifyUrl + Math.random());
	}

	function reverifyChek(){
		var verifyUrl="{U('pinglun/verify' , 'pverify', true)}" + fix;
		var verify=document.getElementById('reverify');
		verify.setAttribute('src',verifyUrl + Math.random());
	}
</script>
{if !$mark}
<a class="inputcss login" style="cursor:pointer;">登陆</a>&nbsp;&nbsp;&nbsp;<a class="inputcss reg" style="cursor:pointer;">注册</a>
<div id="show_reg_Mark" class="dialog" style="display:none">
	<form action="{U('user/users/reg', 'reg')}" method="post">
		(注：用户ID一经注册不能修改！)<br>
		<input type="text" name="username" value="" placeholder="昵称!"/><br>
		<input type="text" name="user_id" value="" placeholder="用户ID!(仅英文)"/><br>
		<input type="password" name="password" value="" placeholder="密码!"/><br>
		<input type="text" name="url" value="" placeholder="网址!"/><br>
		<input type="text" name="email" value="" placeholder="邮箱!"/><br>
		<input type="text" name="code" style="width:60px;" placeholder="验证码！"/>
		<img src="{U('user/users/regverify' , 'rverify', true)}" id="regverify" onclick="verifyregChek()" /><br>
		<input type="hidden" name="talk" value="open">
		<input type="hidden" name="id" value="{$id}" />
		<input type="submit" class="inputcss" style="cursor:pointer;" value="注册">
		&nbsp;&nbsp;&nbsp;
		<a class="inputcss regclose" style="cursor:pointer;">关闭</a>
	</form>
</div>
<div id="show_login_Mark" class="dialog" style="display:none">
	<form action="{U('user/users/login', 'login')}" method="post">
		<input type="text" name="user_id" value="" placeholder="用户ID!"/><br>
		<input type="password" name="password" value="" placeholder="密码!"/><br>
		<input type="text" name="code" style="width:60px;" placeholder="验证码！"/>
		<img src="{U('user/users/loginverify' , 'lverify', true)}" id="loginverify" onclick="verifyloginChek()" /><br>
		<input type="hidden" name="id" value="{$id}" />
		<input type="submit" class="inputcss" style="cursor:pointer;" value="登陆">
		&nbsp;&nbsp;&nbsp;
		<a class="inputcss loginclose" style="cursor:pointer;">关闭</a>
	</form>
</div>
{else}
<div id="show_write_Mark" class="dialog" style="display:none">
	<form action="{U('user/users/writedata','uwrite')}" method="post">
		(注：用户ID不能修改！)<br>
		<input type="text" name="username" value="{$user['username']}"/><br>
		<input type="text" name="user_id" value="{$user['user_id']}" readonly="readonly" /><br>
		<input type="password" name="password" value="" placeholder="密码!"/><br>
		<input type="text" name="url" value="{$user['url']}" placeholder="网址!"/><br>
		<input type="text" name="email" value="{$user['email']}" placeholder="邮箱!"/><br>
		<input type="text" name="talk" value="{if $talk}账号正常{else}账号被禁言{/if}"  readonly="readonly"/><br>
		<input type="text" name="msg" value="{$user['msg']}" placeholder="用户头像（URL链接）" /><br>
		<input type="text" name="regtime" value="{$user['regtime']}"  readonly="readonly" placeholder="注册时间!" /><br>
		<input type="hidden" name="id" value="{$id}" />
		<input type="submit"  class="inputcss" style="cursor:pointer;" value="修改" />
		&nbsp;&nbsp;&nbsp;
		<a class="inputcss writeclose" style="cursor:pointer;">关闭</a>
	</form>
</div>
<a class="inputcss writedata" style="cursor:pointer;">修改</a>
&nbsp;&nbsp;&nbsp;
<a href="{U('user/users/logout', array('pid'=>$id))}" style="cursor:pointer;" class="inputcss">登出</a>
&nbsp;&nbsp;&nbsp;
{/if}
{if $canpl || $mark}
{if $talk}
<form action="{U('pinglun/add', 'add')}" method="post">
	<table class="reply">
		{if empty($checksessionuser)}
		<tr>
			<td>
				<input type="text" class="username1" name="username" value="{$user['username']}" placeholder="昵称！" {if $mark}readonly="readonly"{/if}/> （<font color="red">*</font>）
			</td>
		</tr>
		<tr>
			<td>
				<input type="text" name="url" value="{$user['url']}" placeholder="以：http:// 开头__可选填~！" {if $mark}readonly="readonly"{/if}/>
			</td>
		</tr>
		<tr>
			<td>
				<input type="text" class="useremail1" name="useremail" value="{$user['email']}" placeholder="E-mail！" {if $mark}readonly="readonly"{/if}/> （<font color="red">*</font>）
			</td>
		</tr>
		{/if}
		<tr>
			<td>
				<textarea class="usercontent1" name="content" id="content" placeholder="请文明用语~！" ></textarea> （<font color="red">*</font>）<br/>
				<span class="emotion"></span>
			</div>
		</td>
	</tr>
	<tr>
		<td colspan="2">
			<input type="text" name="code" style="width:60px;" placeholder="验证码！"/>
			<img src="{U('pinglun/verify' , 'pverify', true)}" id="verify" onclick="verifyChek()" />
			<input type="submit"  class="subli" value="提交" />
		</td>
	</tr>
</table>
<input id="pid" type="hidden" name="pid" value="0"/>
<input type="hidden" name="id" value="{$id}" />
<input type="hidden" name="user_id" value="{$user['user_id']}" />
</form>
{else}
<br><br><font color="red">您的账号被禁言，请联系博客管理员~！</font><br><br>
{/if}
{else}
<br><br><font color="red">博客开启 登陆 后才能发表讨论~！</font><br><br>
{/if}
<div class="br"></div>
<div id="comment"></div>
<div id="wrapper"></div>
<script type="text/javascript">
	ppget(1);
	function ppget(page){
		var wrapper = document.getElementById("wrapper");
		$.get("{U('pinglun/ajaxp', array('ppget'=>$id))}", {p: page },
			function(data){
				wrapper.innerHTML = data;
			});
	}
	function getId(obj){
		$(".rid-" + obj).after('<form action="{U("pinglun/add", "add")}" method="post" class="hideforme-' + obj + '"><table class="reply">{if empty($checksessionuser)}<tr><td><input type="text" class="username" name="username" value="{$user["username"]}" placeholder="昵称！" {if $mark}readonly="readonly"{/if}/> （<font color="red">*</font>）</td></tr><tr><td><input type="text" class="input-group url" name="url" value="{$user["url"]}" placeholder="以：http:// 开头__可选填~！" {if $mark}readonly="readonly"{/if}/></td></tr><tr><td><input type="text" class="useremail" name="useremail" value="{$user["email"]}" placeholder="E-mail！" {if $mark}readonly="readonly"{/if}/> （<font color="red">*</font>）</td></tr>{/if}<tr><td><textarea name="content" id="content2" class="usercontent" placeholder="请文明用语~！" ></textarea> （<font color="red">*</font>）<br/><span class="emotion2"></span></div></td></tr><tr><td colspan="2"><input type="text" name="code" style="width:60px;" placeholder="验证码！"/><img src="{U("pinglun/verify" , "pverify", true)}" id="reverify" onclick="reverifyChek()" /><input type="hidden" name="id" value="{$id}" /><input type="hidden" name="user_id" value="{$user["user_id"]}" /><input id="ppid" type="hidden" name="pid" value="' + obj + '"/><input  class="inputcsss" type="submit" value="提交"></td></tr></table></form>');
		$(".inputcsss").click(function() {
			var name =  $('.username').val();
			var email = $('.useremail').val();
			var content = $('.usercontent').val();
			if (name == '' || email == '' || content == '') {
				alert('带（*）号为必填！');
				return false;
			}
		});
		$('.emotion2').msG({
				id: 'msg', //表情ID
				assign: 'content2', //赋予到具体位置
				path: '{DOMAIN}{ROOT_URL}/Public/Resources/PingLun_Msg/',//表情路径
			});
		$('.hiderepost-' + obj).show();
		$('.showrepost-' + obj).hide();
	}

	function hiderepost(obj){
		$('.hideforme-' + obj).remove();
		$('.hiderepost-' + obj).hide();
		$('.showrepost-' + obj).show();
	}

	$(".login").click(function(){
		$('#show_login_Mark').show();
	});
	$(".reg").click(function(){
		$('#show_reg_Mark').show();
	});
	$(".writedata").click(function(){
		$('#show_write_Mark').show();
	});
	$(".writeclose").click(function(){
		$('#show_write_Mark').hide();
	});
	$(".loginclose").click(function(){
		$('#show_login_Mark').hide();
	});
	$(".regclose").click(function(){
		$('#show_reg_Mark').hide();
	});
	$('.emotion').msG({
			id: 'msg', //表情ID
			assign: 'content', //赋予到具体位置
			path: '{DOMAIN}{ROOT_URL}/Public/Resources/PingLun_Msg/',//表情路径
		});

	$(".subli").click(function() {
		var name =  $('.username1').val();
		var email = $('.useremail1').val();
		var content = $('.usercontent1').val();
		if (name == '' || email == '' || content == '') {
			alert('带（*）号为必填！');
			return false;
		}
	});
</script>